use dbus;
use dbus::arg;
use dbus::nonblock;

pub trait OrgBluezProfileManager1 {
    fn register_profile(
        &self,
        profile: dbus::Path,
        uuid: &str,
        options: ::std::collections::HashMap<&str, arg::Variant<Box<dyn arg::RefArg>>>,
    ) -> nonblock::MethodReply<()>;
    fn unregister_profile(&self, profile: dbus::Path) -> nonblock::MethodReply<()>;
}

impl<'a, T: nonblock::NonblockReply, C: ::std::ops::Deref<Target = T>> OrgBluezProfileManager1
    for nonblock::Proxy<'a, C>
{
    fn register_profile(
        &self,
        profile: dbus::Path,
        uuid: &str,
        options: ::std::collections::HashMap<&str, arg::Variant<Box<dyn arg::RefArg>>>,
    ) -> nonblock::MethodReply<()> {
        self.method_call(
            "org.bluez.ProfileManager1",
            "RegisterProfile",
            (profile, uuid, options),
        )
    }

    fn unregister_profile(&self, profile: dbus::Path) -> nonblock::MethodReply<()> {
        self.method_call("org.bluez.ProfileManager1", "UnregisterProfile", (profile,))
    }
}
